package com.ruge.core.error;

import com.ruge.core.exception.IError;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * description: BaseError
 * create time at 2022/6/6 11:51
 *
 * @author alice.ruge
 * @since 0.0.3
 */

@NoArgsConstructor
@AllArgsConstructor
public enum BaseError implements IError {
    /**
     * 基础异常
     */
    PARAMETER_IS_NULL("0001", "参数不能为空!"),
    ASSERT_FAILED("0002", "断言校验失败!"),
    DATA_HAS_LOCKED("0003", "数据已锁定,请联系管理员解锁!"),
    ;

    private String errorCode;
    private String errorMessage;
    private static final String NAME_SPACE = "BASE-ERROR";

    @Override
    public String getNamespace() {
        return NAME_SPACE;
    }

    @Override
    public String getErrorCode() {
        return NAME_SPACE + "." + errorCode;
    }

    @Override
    public String getErrorMessage() {
        return errorMessage;
    }

}
